Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SY-1120 Server-Side Downsampling #836

Merged
merged 63 commits into from
Oct 3, 2024
Merged

SY-1120 Server-Side Downsampling #836

merged 63 commits into from
Oct 3, 2024

Conversation

Lham42
Copy link
Contributor

@Lham42 Lham42 commented Sep 24, 2024

Feature Pull Request Template

Key Information

Description

Summary of changes:

  • Added optional parameter in streamer config for cpp, py and ts clients for downsample factor which defaults to 1.
  • Created a "service" directory to move service layer packages into
  • Created a service layer framer package and replaced existing usage of the distribution layer framer service in the API layer
  • I added downsampling to the streamer on the server. Currently specified as a factor (e.g. a downsampling factor of n means you retain every nth sample)
  • Updated documentation for streaming

Basic Readiness Checklist

  • I have performed a self-review of my code.
  • I have added relevant tests to cover the changes to CI.
  • I have updated user facing documentation accordingly.
  • I have verified code coverage targets are met.

Migrations

  • Console - I have ensured that previous versions of stored data structures are
    properly migrated to new formats.
  • Server - I have ensured that previous versions of stored data structures are
    properly migrated to new formats.

Additional Notes

  • These changes deal with concurrency.
  • These changes affect UI.

Manual QA Additions

  • I have updated the Release Candidate template
    with necessary manual QA steps to test my change.

Breaking Changes

Please list any breaking changes to public or internal packages.

Reviwer Checklist

  • Sufficient test coverage of new additions.
  • Verified all steps in the Readiness checklists.
  • UI changes have been tested.
  • Style and formatting is consistent.
  • Reviewed any relevant changes to concurrent code for safety.
  • Sufficient comments and clarity of code.
  • Any additional documentation necessary for feature is provided and has been reviewed for clarity.

@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 8.82353% with 124 lines in your changes missing coverage. Please review.

Project coverage is 46.63%. Comparing base (d92b585) to head (b9c4530).
Report is 1 commits behind head on rc.

Files with missing lines Patch % Lines
...nnax/pkg/service/framer/downsampler/downsampler.go 0.00% 89 Missing ⚠️
synnax/pkg/service/framer/service.go 0.00% 18 Missing ⚠️
synnax/pkg/api/grpc/framer.go 0.00% 8 Missing ⚠️
synnax/pkg/api/grpc/v1/framer.pb.go 0.00% 5 Missing ⚠️
synnax/cmd/start.go 0.00% 2 Missing ⚠️
client/ts/src/framer/streamer.ts 83.33% 1 Missing ⚠️
synnax/pkg/api/framer.go 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##               rc     #836      +/-   ##
==========================================
+ Coverage   45.89%   46.63%   +0.74%     
==========================================
  Files        1101     1102       +1     
  Lines       69787    68482    -1305     
  Branches     3553     3544       -9     
==========================================
- Hits        32031    31939      -92     
+ Misses      36699    35485    -1214     
- Partials     1057     1058       +1     
Flag Coverage Δ
clientpy 86.04% <ø> (ø)
clientts 62.98% <85.71%> (+0.01%) ⬆️
synnax 28.86% <4.65%> (-0.27%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -117,6 +117,7 @@ class StreamerConfig {
public:
/// @brief the channels to stream.
std::vector<ChannelKey> channels;
int downsample_factor = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to document this parameter.

synnax/pkg/service/framer/service.go Outdated Show resolved Hide resolved
synnax/pkg/service/framer/downsampler/downsampler.go Outdated Show resolved Hide resolved
return dsResponse
}

func downsampleSeries(series telem.Series, factor int) telem.Series {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this function will panic or have unexpected behavior on series with variable length data types (JSON, string)? I think so.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should I return an error if a channel of a variable length data type is being downsampled?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would downsample it. The delimiter for JSON and STRING data types is a newline character.

return dsResponse
}

func downsampleSeries(series telem.Series, factor int) telem.Series {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would downsample it. The delimiter for JSON and STRING data types is a newline character.

synnax/pkg/service/framer/downsampler/downsampler.go Outdated Show resolved Hide resolved
synnax/pkg/service/framer/downsampler/downsampler.go Outdated Show resolved Hide resolved
@Lham42 Lham42 merged commit c243956 into rc Oct 3, 2024
32 checks passed
@emilbon99 emilbon99 deleted the eislam/sy-1120-downsampling branch October 5, 2024 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants